import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Index, //component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') 懒加载
    children: [
      {
        path: '/data',
        name: 'data',
        component: () => import("../views/data/data.vue")
      },
      {
        path: '/chart',
        name: 'chart',
        component: () => import("../views/chart/chart.vue")
      },
      {
        path: '/detail',
        name: 'detail',
        component: () => import("../views/detail/detail.vue")
      },
      {
        path: '/page4',
        name: 'page4',
        component: () => import("../views/page4/page4.vue")
      }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
